package com.liqi.frame.comm.po;

import cn.hutool.json.JSONUtil;
import com.liqi.frame.comm.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;

import java.util.Date;

/**
 * 用户执久对象
 */
@Data
@ApiModel(value = "User对象")
public class User extends BaseEntity {
    //0:禁止登录
    public static final int _0 = new Integer(0);
    //1:有效
    public static final int _1 = new Integer(1);

    @ApiModelProperty(value = "主键", example = "1")
    private String id;
    @ApiModelProperty(value = "用户名")
    private String username;
    @ApiModelProperty(value = "密码（transient表示不被序列化）")
    private transient String pswd;
    @ApiModelProperty(value = "状态")
    private int status;
    @ApiModelProperty(value = "用户全名")
    private String fullname;
    @ApiModelProperty(value = "手机号")
    private String phone;
    @ApiModelProperty(value = "邮箱")
    private String email;
    @ApiModelProperty(value = "说明")
    private String comment;
    private Date lastLoginTime;
    @ApiModelProperty(value = "序号")
    private Float orderId;
    @ApiModelProperty(value = "主题")
    private String theme;
    @ApiModelProperty(value = "头像")
    private String avatar;
    @ApiModelProperty(value = "组织id")
    private String groupId;
    @ApiModelProperty(value = "组织名称")
    private String groupName;
    @ApiModelProperty(value = "用户类型")
    private String userType;


    public User(User user) {
        this.id = user.getId();
        this.username = user.getUsername();
        this.pswd = user.getPswd();
        this.status = user.getStatus();
        this.fullname = user.getFullname();
        this.phone = user.getPhone();
        this.email = user.getEmail();
        this.comment = user.getComment();
        this.lastLoginTime = user.getLastLoginTime();
        this.orderId = user.getOrderId();
        this.theme = user.getTheme();
        this.avatar = user.getAvatar();
        this.groupId = user.getGroupId();
        this.userType = user.getUserType();
    }

    public User() {
    }
}
